# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def fragment_image_path(fragment)
    "#{root_path}images/jobs/#{fragment.job_id}/#{fragment.job_id}_#{fragment.peaknum}_#{fragment.fragment}.svg"
  end

  def svg_image_tag(source, options = {})
    "<!--[if IE]>" <<
      content_tag(:object, nil, { :src => source, :classid => "image/svg+xml" }.merge(options)) <<
    "<![endif]--> <!--[if !IE]>-->" <<
      content_tag(:object, nil, { :data => source, :type => "image/svg+xml" }.merge(options)) <<
    "<!--<![endif]-->"
  end

  def navigation_item_tag(name, options = {}, html_options = {})
    content_tag(:li, :class => (request.path == options ? "active" : nil)) do
      link_to(name, options, html_options)
    end
  end
end
